import request from '@/utils/request'
import querystring from 'querystring'

/**
 * 分页查询门店
 * @param {*} form 
 * @param {*} pageSize 
 * @param {*} currentPage 
 */
export function dataList(form, pageSize, currentPage) {
  const data = {
    param: form,
    pageSize: pageSize,
    pageNo: currentPage
  }
  return request.post('/store/page',data)
}
/**
 * 新增门店
 * @param {*} options 
 */
export function addData(options) {
  return request.post('/store/save', options)
}

/**
 * 修改门店
 * @param {*} options 
 */
export function updateData(options) {
  return request.put('/store/save', options)
}

/**
 * 获取门店详情
 * @param {*} id 
 */
export function details(id) {
  return request.get(`/store/${id}`)
}

/**
 * 根据选择的门店等级获取上级门店
 * @param {*} level 
 */
export function getLevelStore(level) {
  return request.get(`/store/getUpStore/${level}`)
}

/**
 * 删除门店
 * @param {*} id 
 */
export function deleteData(id) {
  return request.delete(`/store/${id}`)
}
